home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-23 | 1.9 KB | 49 lines | [TEXT/PJMM] |
- unit INITDoInstall;
- {Copyright © 1990, David B. Lamkins}
- {All rights reserved.}
-
- interface
-
- uses
- INITShellGlobals;
-
- type
- callbackCode = (initCallback, {param1=maxPatches,param2=maxVBLs,param3=globalsSize}
- setPatch, {param1=resID, param2=trapWord}
- setVBL, {param1=resID, param2=count, param3=phase}
- failInstall, {no params}
- doNotInstall, {no params}
- suppressIcon {no params}
- );
-
- procedure DoInstall (procedure InstallCallback (func: callbackCode; param1, param2, param3: INTEGER));
-
- implementation
-
- {The following code is called only once, at INIT time. If there are any trap patches or VBL}
- {tasks, load and install them using InstallCallback with the setPatch or setVBL function code.}
- {Patch and VBL installation errors are handled by the callback routine. If you want to execute}
- {one-time code, do it here and signal any errors using the provided failInstall callback code.}
- {}
- {Permanently resident code for patches and VBLs is compiled in separate projects as a resource}
- {of type defined by the ResidentType constant.}
- {}
- {Global data to be used by patches and VBLs is declared in the INITShellGlobals unit.}
- {}
- {The INITShellLoader unit initializes QuickDraw and opens a port for you to use. The port remains}
- {open through DoInstall, and is actually used by the loader when it draws the INIT icon. You can}
- {use it if you want to put up dialogs, splash screens, or whatever - but read TN 247 first…}
-
- procedure DoInstall (procedure InstallCallback (func: callbackCode; param1, param2, param3: INTEGER));
- const
- numberOfPatches = 2;
- numberOfVBLs = 0;
- AddResourceTrap = $A9AB;
- ChangedResourceTrap = $A9AA;
- begin
- InstallCallback(initCallback, numberOfPatches, numberOfVBLs, SIZEOF(INITGlobals));
- InstallCallback(setPatch, 128, AddResourceTrap, 0);
- InstallCallback(setPatch, 129, ChangedResourceTrap, 0);
- end;
-
- end.